<?php

namespace app\mainadmin\model;

use app\BaseModel;
use think\facade\Cache;

//*------------------------------------------------------ */
//-- 站内信
/*------------------------------------------------------ */

class MessageModel extends BaseModel
{
    protected $table = 'main_message';
    public $pk = 'message_id';
    protected $mkey = 'message_info_mkey_';
    protected $messageType = ['all'=>'系统公告','channel'=>'指定代理层级','distribution'=>'指定分销身份','byuser'=>'指定会员'];
    /*------------------------------------------------------ */
    //--  清除memcache
    /*------------------------------------------------------ */
    public function cleanMemcache($message_id=0)
    {

    }
    public function getMessageType(){
        $settings = settings();
        $messageType = $this->messageType;
        if ($settings['sys_model_distribution'] != 1){
            unset($messageType['distribution']);
        }
        if ($settings['sys_model_channel'] != 1){
            unset($messageType['channel']);
        }
        return $messageType;
    }


}
